﻿// -----------------------------------------------------------------------
// <copyright file="Program.cs" company="Microsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace FxCopContrib.RegexCop.Tester
{
    using System.Collections.Generic;
    using System.Text.RegularExpressions;
    using FxCopContrib.Experimental.RegexCop;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class Program
    {
        private static readonly Regex Test1 = new Regex(@"\w\s", RegexOptions.ECMAScript | RegexOptions.IgnorePatternWhitespace);

        public static void Main(string[] args)
        {
            RegexParser parser = new RegexParser();

            var tree = parser.Parse("a*a*?[^a]*[^a]*?", RegexOptions.None);
            List<RegexNode> nodes = new List<RegexNode>();
            nodes.Add(tree.Root);

            while (nodes.Count > 0)
            {
                var node = nodes[0];
                nodes.RemoveAt(0);

                RegexCharClass charClass = node.CharClass;
                nodes.AddRange(node.Children);
            }
        }
    }
}
